From bcdd6aeee0f44b5fed9f8b95e49f088169301e4d Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Wed, 20 Apr 2005 14:29:18 +0000 Subject: [PATCH] bitkeeper revision 1.1342 (4266673eMuou_Ng4Ze7pzPUJ4IL7bg) Fix memset/memcmp/memmove declaration/definition. Signed-off-by: Keir Fraser --- .rootkeys | 1 + xen/arch/x86/string.c | 27 +++++++++++++++++++++++++++ xen/include/asm-x86/x86_32/string.h | 21 ++++++++++++--------- xen/include/asm-x86/x86_64/string.h | 12 +++++++++++- 4 files changed, 51 insertions(+), 10 deletions(-) create mode 100644 xen/arch/x86/string.c diff --git a/.rootkeys b/.rootkeys index 537470ff4b..66b981152c 100644 --- a/.rootkeys +++ b/.rootkeys @@ -1224,6 +1224,7 @@ 405b8599xI_PoEr3zZoJ2on-jdn7iw xen/arch/x86/shadow.c 3ddb79bcSx2e8JSR3pdSGa8x1ScYzA xen/arch/x86/smp.c 3ddb79bcfUN3-UBCPzX26IU8bq-3aw xen/arch/x86/smpboot.c +4266673dBje6CS6CwQ3lEdvWbf5Dcw xen/arch/x86/string.c 3ddb79bc-Udq7ol-NX4q9XsYnN7A2Q xen/arch/x86/time.c 3ddb79bccYVzXZJyVaxuv5T42Z1Fsw xen/arch/x86/trampoline.S 3ddb79bcOftONV9h4QCxXOfiT0h91w xen/arch/x86/traps.c diff --git a/xen/arch/x86/string.c b/xen/arch/x86/string.c new file mode 100644 index 0000000000..5a7788ba11 --- /dev/null +++ b/xen/arch/x86/string.c @@ -0,0 +1,27 @@ +/****************************************************************************** + * string.c + * + * These provide something for compiler-emitted string operations to link + * against. + */ + +#include +#include + +#undef memmove +void *memmove(void *dest, const void *src, size_t count) +{ + return __memmove(dest, src, count); +} + +#undef memcpy +void *memcpy(void *dest, const void *src, size_t count) +{ + return __memcpy(dest, src, count); +} + +#undef memset +void *memset(void *s, int c, size_t count) +{ + return __memset(s, c, count); +} diff --git a/xen/include/asm-x86/x86_32/string.h b/xen/include/asm-x86/x86_32/string.h index 43fad09eea..b25ec8df61 100644 --- a/xen/include/asm-x86/x86_32/string.h +++ b/xen/include/asm-x86/x86_32/string.h @@ -184,7 +184,7 @@ __asm__ __volatile__( return __res; } -static inline void * __memcpy(void * to, const void * from, size_t n) +static inline void * __variable_memcpy(void * to, const void * from, size_t n) { int d0, d1, d2; __asm__ __volatile__( @@ -272,12 +272,13 @@ __asm__ __volatile__( \ } #define __HAVE_ARCH_MEMCPY -static always_inline __attribute_used__ -void memcpy(void *t, const void *f, size_t n) +#define memcpy(t,f,n) (__memcpy((t),(f),(n))) +static always_inline +void *__memcpy(void *t, const void *f, size_t n) { - (__builtin_constant_p(n) ? + return (__builtin_constant_p(n) ? __constant_memcpy((t),(f),(n)) : - __memcpy((t),(f),(n))); + __variable_memcpy((t),(f),(n))); } /* @@ -299,7 +300,8 @@ void memcpy(void *t, const void *f, size_t n) */ #define __HAVE_ARCH_MEMMOVE -static inline void * memmove(void * dest,const void * src, size_t n) +#define memmove(dest,src,n) (__memmove((dest),(src),(n))) +static inline void *__memmove(void * dest,const void * src, size_t n) { int d0, d1, d2; if (dest